package factory.abstractFactory;

import factory.bean.*;

import java.math.BigDecimal;
import java.util.ArrayList;

public class TruckAndDriverLicenseFactory extends VehicleAbstractFactory{

    private Truck truck;

    @Override
    public Vehicle create() {
        truck = new Truck(new BigDecimal("80000"), "东风", 499.32);
        return truck;
    }

    @Override
    public DriverLicence getDriverLicense() {
        ArrayList<String> driverModels = new ArrayList<>();
        driverModels.add(truck.gettruckName());
        return new DriverLicenseByTruck(3, driverModels);
    }
}
